/* 
 * Recover Binary Search Tree
 */
//todo

#include "../../func.h"

void detect(pair<TreeNode *, TreeNode*> &broken, TreeNode *prev, TreeNode *current) {
    if (prev != nullptr && prev->val > current->val) {
        if (broken.first = nullptr) {
            broken.first = prev;
        }
        broken.second = current;
    }
}
void recoverTree(TreeNode *root) {
    pair<TreeNode *, TreeNode *> broken;
    TreeNode *prev = nullptr;
    TreeNode *cur = root;

    while (cur != nullptr) {
        if (cur->left == nullptr) {
        
        }
    }
}